<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC>
<html>
<head>
<base href="<%=basePath%>">

<title>个人中心</title>
<script src="js/jquery.min.js"></script>
<link rel="stylesheet" href="css/bootstrap.css">
<script src="js/bootstrap.js"></script>
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/personInfo.css">
<link rel="stylesheet" href="css/bootstrap.css">
<script src="js/personInfo.js"></script>
<script src="js/main.js"></script>
<script type="text/javascript">
	$(function() {
		$("#lookOffence").click(function() {
			alert("你没有任何违规记录，请继续保持");
		});
		
		$("#loginOut").click(function(){
			if(userId == "null"){
				window.location="admin/userLogin.jsp";
			};
			if(userId != "null"){
				window.location="login/loginOut.do";
			};
		});
	});
</script>

</head>

<body>
	<header ></header>
	<div class="person-info container">
		<span>欢迎: ${userName}</span> &nbsp&nbsp&nbsp<a
			href="javaScript:void(0)" id="loginOut">${userName!=null ? '退出' : '登录'}</a>
			<input type="hidden" value="${userName}" id="userName">
		<div class="person-info-show"></div>
	</div>
	
	<section class="main-section">
		<div class="section-left">
			<div class="person-pic">
				<img src="${user.userAvatar}" alt="">
				<p>${user.userName}</p>
				<p>
					<a href="javaScript:void(0)" id="lookOffence">查看我的违规记录</a>
				</p>
			</div>
			<div class="siderbarNav">
				<ul id="">
					<li><a href="javaScript:void(0)"
						class="navActive js-setNavActive">我的宝贝</a></li>
					<li><a href="javaScript:void(0)" class="js-setNavActive">已售出的</a></li>
					<li><a href="javaScript:void(0)" class="js-setNavActive">我的消息</a></li>
					<li><a href="javaScript:void(0)" class="js-setNavActive">我赞过的</a></li>
					<li><a href="javaScript:void(0)" class="js-setNavActive">已屏蔽的人</a></li>
				</ul>
			</div>
		</div>
		<div class="section-right">
			<div class="search-bar">
				<form action="" class="clearFloat">
					<label for="" class="fl">在售宝贝 </label> <span class="fr">仅显示最近三个月,<a
						href="javaScript:void(0)">点击查看</a>三个月前的宝贝
					</span>
				</form>
			</div>

			<!--在这里用钩子？-->
			<div class="js-change-model">

				<c:forEach var="product" varStatus="status" items="${productList}">
					<c:if test="${product.productState==101}">
						<div class="details-time-info">
							<span class="fl">发布时间:<span>${product.uploadDate}</span></span> <span
								class="fr">最后编辑:<span>${product.uploadDate}</span></span>
						</div>
						<div class="details-info">
							<div class="details-info-pic">
								<figure class="clearFloat">
									<a href="detail/info/${product.productId}.do"><img
										src="${product.imageName}" alt=""></a>
									<p>
										${product.productName}<br> <span>&yen;${product.currentPrice==null ? ' 未定价' : product.currentPrice}</span>
									</p>
								</figure>
							</div>
							<div class="details-info-fix">
								<div class="fix-title">
									<h4 class="fl">在售:</h4>
									<!-- <meter value="0.6" class="fl">60%</meter>
							<span>完成度:<span>60%</span></span><br> -->
									<span style="color:red;">该商品目前正在展示<br /> <b>如已出售<br /></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp请及时下架，以免被打扰。
									</span><br> <a href="userInfo/pullOff/${product.productId}.do"
										class="fr"><i class="glyphicon glyphicon-minus-sign">下架宝贝</i></a>
								</div>
							</div>
						</div>
					</c:if>
				</c:forEach>


			</div>

			<!-- 已售出 -->
			<div class="js-change-model" style="display: none">
				<c:forEach var="product" varStatus="status" items="${productList}">
					<c:if test="${product.productState!=101}">
						<div class="details-time-info">
							<span class="fl">发布时间:<span>${product.uploadDate}</span></span> <span
								class="fr">最后编辑:<span>${product.uploadDate}</span></span>
						</div>
						<div class="details-info">
							<div class="details-info-pic">
								<figure class="clearFloat">
									<a href="detail/info/${product.productId}.do"><img
										src="${product.imageName}" alt=""></a>
									<p>
										${product.productName}<br> <span>&yen;${product.currentPrice==null ? ' 未定价' : product.currentPrice}</span>
									</p>
								</figure>
							</div>
							<div class="details-info-fix">
								<div class="fix-title">
									<h4 class="fl">已下架:</h4>
									<!-- <meter value="0.6" class="fl">60%</meter>
							<span>完成度:<span>60%</span></span><br> -->
									<span style="color:red;">该商品目前已下架<br /> <b>如需再次出售<br /></b>
										&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp请重新上架宝贝。
									</span><br> <a href="userInfo/putOn/${product.productId}.do"
										class="fr"><i class="glyphicon glyphicon-plus-sign">上架宝贝</i></a>
								</div>
							</div>
						</div>
					</c:if>
				</c:forEach>
			</div>
			<div class="js-change-model" style="display: none">没有任何人给你发送信息</div>
			<div class="js-change-model" style="display: none">你没有赞过任何人</div>
			<div class="js-change-model" style="display: none">你没有屏蔽任何人</div>
		</div>
	</section>
	<footer class="main-footer"></footer>
</body>
</html>
